{% extends "lbforum/base_site.html" %}

{% load i18n %}
{% load lbforum_filters %}
{% load lbforum_tags %}
{% load djangohelper_tags %}

{% block title %}
    {{ forum }} - {{ topic_type }} - {{ topic_type2 }} - {{ LBFORUM_TITLE }}
{% endblock %}

{% block content_right_bar %}
    {% include 'lbforum/widgets/cur_user_profile.html' %}

    {% if forum.description %}
        <div class="sep20"></div>
        <div class="box">
            <div class="inner">
                {{forum.description}}
            </div>
        </div>
    {% endif %}

    {% if forum.topictype_set.all.count %}
        <div class="sep20"></div>
        <div class="box">
            <div class="cell">
                <span class="fade">{% trans "Topic Type" %}</span>
            </div>
            <div class="inner">
                <a class="item_node {% if not topic_type2 %}selected{% endif %}" 
                        href="{% forum_url forum topic_type "" %}">
                    <span> {% trans "All" %} </span>
                </a>
                {% for tp in forum.topictype_set.all %}     
                    <a class="item_node {% if topic_type2 == tp.slug %}selected{% endif %}" 
                            href="{% forum_url forum topic_type tp.slug %}">
                        <span> {{ tp }} </span>
                    </a>
                {% endfor %}
            </div>
        </div>
    {% endif %}
{% endblock %}

{% block content_content %}
    {% load pagination_tags %}
    {% autopaginate topics FORUM_PAGE_SIZE %}
    <div class="box">
        <div class="cell" style="padding-bottom: 0px;"><table cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                    <td width="auto" valign="top">
                        <div class="fr" align="right">
                            <span class="snow">
                                {% trans "Topics" %}
                                <strong>[ {% page_range_info page_obj %} ]</strong> 
                            </span> 
                        </div>
                        <span class="bigger">
                            <a href="{% url lbforum_index %}">{{ LBFORUM_TITLE }}</a>
                            <span class="chevron">&raquo;</span>
                            {{ forum }}
                        </span>
                        {% if user.is_authenticated %}
                            <div class="sep10"></div>
                            <div class="sep10"></div>
                            <div align="left">
                                <a href="{% url lbforum_new_topic forum.pk %}" class="super normal button">{% trans "Post new topic" %}</a>
                            </div>
                        {% endif %} 
                        <div class="sep5"></div>
                        <div class="sep10"></div>
                        <div>
                            <div class="tp-btn {% if topic_type != "good" %}selected{% endif %}">
                                <a href="{% forum_url forum "" topic_type2 %}">{% trans "All" %}</a>
                            </div>
                            <div class="tp-btn {% if topic_type == "good" %}selected{% endif %}">
                                <a href="{% forum_url forum "good" topic_type2 %}">{% trans "Distillate District" %}</a>
                            </div>
                        </div>

                    </td>
                </tr>
            </table>
        </div>
        {% include 'lbforum/inc_topic_list.html' %}
        <div class="inner">
            {% paginate %}
        </div>
    </div>
{% endblock %}
